From 977a557a670272dbe97b5e4c7af48c3af0affcdd Mon Sep 17 00:00:00 2001 From: "James M. Cape" Date: Thu, 6 Jan 2005 06:25:30 +0000 Subject: [PATCH] Use default title if NULL is passed. 2005-01-06 James M. Cape * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_new) (gtk_file_chooser_button_new_with_backend): Use default title if NULL is passed. * docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml: Make examples match API. --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml | 3 ++- gtk/gtkfilechooserbutton.c | 11 ++++++----- 6 files changed, 44 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a99b0fa85c..f9f4abddd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-01-06 James M. Cape + + * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_new) + (gtk_file_chooser_button_new_with_backend): Use default title if + NULL is passed. + + * docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml: Make examples + match API. + 2005-01-05 Federico Mena Quintero Fix #161409: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a99b0fa85c..f9f4abddd6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +2005-01-06 James M. Cape + + * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_new) + (gtk_file_chooser_button_new_with_backend): Use default title if + NULL is passed. + + * docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml: Make examples + match API. + 2005-01-05 Federico Mena Quintero Fix #161409: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index a99b0fa85c..f9f4abddd6 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +2005-01-06 James M. Cape + + * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_new) + (gtk_file_chooser_button_new_with_backend): Use default title if + NULL is passed. + + * docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml: Make examples + match API. + 2005-01-05 Federico Mena Quintero Fix #161409: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index a99b0fa85c..f9f4abddd6 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +2005-01-06 James M. Cape + + * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_new) + (gtk_file_chooser_button_new_with_backend): Use default title if + NULL is passed. + + * docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml: Make examples + match API. + 2005-01-05 Federico Mena Quintero Fix #161409: diff --git a/docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml b/docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml index a88eddf481..27e9757e17 100644 --- a/docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml @@ -20,7 +20,8 @@ property to %TRUE. { GtkWidget *button; - button = gtk_file_chooser_button_new (_("Select a file")); + button = gtk_file_chooser_button_new (_("Select a file"), + GTK_FILE_CHOOSER_ACTION_OPEN); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button), "/etc"); } diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index e05fd9a1d7..46d8ccff17 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -62,6 +62,7 @@ #define GTK_FILE_CHOOSER_BUTTON_GET_PRIVATE(object) (GTK_FILE_CHOOSER_BUTTON ((object))->priv) +#define DEFAULT_TITLE N_("Select A File") #define HOME_DISPLAY_NAME N_("Home") #define DESKTOP_DISPLAY_NAME N_("Desktop") #define FALLBACK_DISPLAY_NAME N_("(None)") @@ -349,7 +350,7 @@ gtk_file_chooser_button_class_init (GtkFileChooserButtonClass * class) g_param_spec_string ("title", P_("Title"), P_("The title of the file chooser dialog."), - _("Select a File"), + _(DEFAULT_TITLE), G_PARAM_READWRITE)); /** @@ -2211,7 +2212,7 @@ gtk_file_chooser_button_new (const gchar *title, return g_object_new (GTK_TYPE_FILE_CHOOSER_BUTTON, "action", action, - "title", title, + "title", (title ? title : _(DEFAULT_TITLE)), NULL); } @@ -2236,15 +2237,15 @@ gtk_file_chooser_button_new_with_backend (const gchar *title, action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, NULL); return g_object_new (GTK_TYPE_FILE_CHOOSER_BUTTON, - "title", title, "action", action, + "title", (title ? title : _(DEFAULT_TITLE)), "file-system-backend", backend, NULL); } /** * gtk_file_chooser_button_new_with_dialog: - * @dialog: the #GtkDialog widget to use. + * @dialog: the #GtkFileChooserDialog widget to use. * * Creates a #GtkFileChooserButton widget which uses @dialog as it's * file-picking window. Note that @dialog must be a #GtkFileChooserDialog (or @@ -2323,7 +2324,7 @@ gtk_file_chooser_button_get_width_chars (GtkFileChooserButton *button) /** * gtk_file_chooser_button_set_width_chars: * @button: the button widget to examine. - * @n_chars: the new width, in chracters. + * @n_chars: the new width, in characters. * * Sets the width (in characters) that @button will use to @n_chars. * -- 2.30.2